<?php /* Smarty version 2.6.16, created on 2013-09-10 07:07:28
         compiled from ../templates/default//modules/leads/payamount.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'ucfirst', '../templates/default//modules/leads/payamount.tpl', 132, false),array('modifier', 'str_pad', '../templates/default//modules/leads/payamount.tpl', 295, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['header_start'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php echo '<link rel="stylesheet" type="text/css" href="';  echo $this->_tpl_vars['siteroot'];  echo '/templates/default/style/registration.css"><script type="text/javascript" src="';  echo $this->_tpl_vars['siteroot'];  echo '/includes/js/payment_lead.js"></script><script src="';  echo $this->_tpl_vars['siteroot'];  echo '/includes/js/admin/ajax.js" type="text/javascript" ></script>'; ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['header_end'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php echo '
<script type="text/javascript">


function validateFrm()
{
	
		var isvalid = false;
		isvalid = $("#frmPayment_lead").valid();
		
		
		
		if(isvalid==true)
		{
			var method = $("input[type=\'radio\'][name=\'paymentmethod\']:checked").val();
			if(method ==\'paypal\')
			{
				document.getElementById(\'btnstep4\').value = \'Submit\';
				$("#frmPayment_lead").submit();	
			}
			else
			{
				var year = document.getElementById(\'carddate\').value;
				var mon = document.getElementById(\'cardmonth\').value;
				
				// TODAYS DATE
				var today = new Date();
				var todayDate,todayMonth,todayYear;
				todayDate=parseInt(today.getDate());
				todayMonth=parseInt(today.getMonth());
				todayYear=parseInt(today.getFullYear());
				
				var expYears;
				var expMon;
				expYears = parseInt(year);
				expMon = parseInt(mon);
				
				/************ Check valid Security code ************/
				var cc_code = document.getElementById("cardcode").value;			
				var cc_code_lengh = cc_code.length;
				var cc_type = document.getElementById("cardtype").value;
		
		
				if((todayYear == expYears) && (expMon < todayMonth))
				{
					isvalid = false;
					document.getElementById(\'date_error\').innerHTML = "Please Select Proper Expiration Date.";
					document.getElementById(\'cardmonth\').focus();
					return false;
				}		
				else if(cc_type == "Visa" || cc_type == "MasterCard")
				{	
					if(cc_code_lengh != "3")
					{
						document.getElementById("scode_msg").innerHTML = "Please enter valid security code";
						return false;
					}
					else
					{
						isvalid = true;
						document.getElementById(\'date_error\').innerHTML = "";
						document.getElementById("scode_msg").innerHTML = "";
						if(isvalid == true)
						{
								document.getElementById(\'btnstep4\').value = \'Submit\';
								$("#frmPayment_lead").submit();
						}
						return true;
					}
				}
				else if(cc_type == "AmEx")
				{
					if(cc_code_lengh != "4")
					{
						document.getElementById("scode_msg").innerHTML = "Please enter valid security code";
						return false;
					}
					else
					{
						isvalid = true;
						document.getElementById(\'date_error\').innerHTML = "";
						document.getElementById("scode_msg").innerHTML = "";
						if(isvalid == true)
						{
								document.getElementById(\'btnstep4\').value = \'Submit\';
								$("#frmPayment_lead").submit();
						}
						return true;
					}
				}
				/************ End of Check valid Security code ************/
			}
				
		}
	
}
function showCity(sid){
	ajax.sendrequest("GET",SITEROOT + "/admin/city/show_city.php",{sid:sid},"","isShowCity");
}

</script>
'; ?>


   <!-- MIDDLE CONTAIN GOES HERE -->
 
<section class="middle_portion">
	<section class="inner_head"><?php if ($_GET['id1'] != ''): ?> Pay Lead Price<?php else: ?>Membership Plan Renewal<?php endif; ?></section>
     <?php if ($this->_tpl_vars['sucmsg']): ?><span class="error" ><?php echo $this->_tpl_vars['sucmsg']; ?>
</span> <?php endif; ?>   
    <?php if ($this->_tpl_vars['msg']): ?><span class="error" ><?php echo $this->_tpl_vars['msg']; ?>
</span> <?php endif; ?>  
    <?php if ($this->_tpl_vars['errorMsg']): ?><div style="padding:5px;"><div class="error_msg" style="width:900px;" > <span><?php echo $this->_tpl_vars['errorMsg']; ?>
</span></div></div><?php endif; ?>  
    
    <section class="inner_containstart">  
      
        <section class="buyerinfo"> 
        <?php if ($_GET['id1'] != ''): ?>      
           <dl>
            <dt>Lead Price:</dt>
            <dd><?php if ($_GET['id1'] != ''): ?>$<?php echo $this->_tpl_vars['getleadprice']['price'];  endif;  if ($_POST['membershipplan'] != ''): ?> $<?php echo $_POST['membershipplan']; ?>
 <?php endif; ?></dd>
            <section class="clear"></section>
           </dl>
        <?php endif; ?>
        <?php if ($_POST['membershipplan'] != ''): ?>      
	       <dl>
            <dt>Plane Name:</dt>
            <dd><?php echo ((is_array($_tmp=$this->_tpl_vars['getplan_details']['name'])) ? $this->_run_mod_handler('ucfirst', true, $_tmp) : smarty_modifier_ucfirst($_tmp)); ?>
</dd>
            <section class="clear"></section>
           </dl>
           <dl>
            <dt>Plane Amount:</dt>
            <dd>$<?php echo $this->_tpl_vars['getplan_details']['price']; ?>
</dd>
            <section class="clear"></section>
           </dl>
           <dl>
            <dt>Plane Leads:</dt>
            <dd><?php echo $this->_tpl_vars['getplan_details']['leads']; ?>
</dd>
            <section class="clear"></section>
           </dl>
        <?php endif; ?>
        
        
        </section>  
	
    <section class="regist_form no_bor lF">
    
     <form id="frmPayment_lead" name="frmPayment_lead" method="POST" action ="<?php echo $this->_tpl_vars['siteroot']; ?>
/leads/gotopayment/" > 
     <?php if ($_GET['id1'] != ''): ?>
     	<input type="hidden" name="leadprice" id="leadprice" value="<?php echo $this->_tpl_vars['getleadprice']['price']; ?>
" />
        <input type="hidden" name="jobid" id="jobid" value="<?php echo $_GET['id1']; ?>
"  /> 
     <?php endif; ?> 
     <?php if ($_POST['membershipplan'] != ''): ?>
     	<input type="hidden" name="membershipplan" id="membershipplan" value="<?php echo $_POST['membershipplan']; ?>
" />
        <input type="hidden" name="plan_id" id="plan_id" value="<?php echo $_POST['plan_id']; ?>
"  /> 
        <input type="hidden" name="jobid" id="jobid" value="<?php echo $_POST['jobid']; ?>
"  />         
     <?php endif; ?>   
     <!--
     <h1 class="payhead">If your Interested then please enter message</h1><br />
     <dl>
        	<dt>Message</dt>
            <dd><textarea class="textarea" name="message" id="message"  style="resize:none;" ><?php echo $_POST['message']; ?>
</textarea></dd>
            <section class="clear"></section>
     </dl>  
     <section class="clear"></section>     
     -->
    <h1 class="payhead">Billing Information</h1><br />
   
         <dl>
        	<dt>First  Name</dt>
            <dd><input type="text" class="input" name="cardfirstname" id="cardfirstname" value="<?php echo $_POST['cardfirstname']; ?>
" maxlength="20" /></dd>
            <section class="clear"></section>
        </dl>
         <dl>
        	<dt>Last  Name</dt>
            <dd><input type="text" class="input" name="cardllastname" id="cardllastname" value="<?php echo $_POST['cardllastname']; ?>
" maxlength="20"/></dd>
            <section class="clear"></section>
        </dl>
                <dl>
        	<dt>Address Address</dt>
            <dd><input type="text" class="input" name="billingaddr" id="billingaddr" value="<?php echo $_POST['billingaddr']; ?>
" maxlength="40"/></dd>
            <section class="clear"></section>
        </dl>
        
        
        <dl>
        	<dt>Country</dt>
              <dd>
              	  <select class="input3" id="country" name="country">
                  		<option value="226">Australia</option>
                  </select></dd>
            <section class="clear"></section>
        </dl>
        <section class="clear"></section>
        <dl>
        	<dt>State/Province</dt>
              <dd>
              	  <select class="input3" id="state" name="state" onchange="showCity(this.value);">
                    <option value="">Select State</option>
                    <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['stateArray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>               
		              <option value="<?php echo $this->_tpl_vars['stateArray'][$this->_sections['i']['index']]['state_id']; ?>
" <?php if ($this->_tpl_vars['stateArray'][$this->_sections['i']['index']]['state_id'] == $_POST['state']): ?> selected="selected" <?php endif; ?>><?php echo $this->_tpl_vars['stateArray'][$this->_sections['i']['index']]['state_name']; ?>
</option>
        		    <?php endfor; endif; ?>
                          
                  </select>
              </dd>
            <section class="clear"></section>
        </dl>
                
       <dl class="space30">
        	<dt>City</dt>
            <dd>
            <div id="isShowCity">
            	<select class="input30" id="city" name="city">
                  <option value="">Select City</option>
                   <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['cityArray']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
			           <option value="<?php echo $this->_tpl_vars['cityArray'][$this->_sections['i']['index']]['city_id']; ?>
" <?php if ($this->_tpl_vars['cityArray'][$this->_sections['i']['index']]['city_id'] == $_POST['city']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['cityArray'][$this->_sections['i']['index']]['city_name']; ?>
</option>
        	       <?php endfor; endif; ?>                                  
                  </select>
               </div>   
            	<!--<input type="text" class="input" name="" id="" value="">-->
            </dd>
            <section class="clear"></section>
        </dl>
       <dl class="space20">
        	<dt>Postal Code</dt>
            <dd><input type="text" class="input20" name="cardpostalcode" id="cardpostalcode" value="<?php echo $_POST['cardpostalcode']; ?>
" maxlength="10"/></dd>
            <section class="clear"></section>
        </dl>
        
        <section class="clear"></section>
        
        
         <h1 class="payhead">Payment Method</h1>
         <div class="payment">
         <?php if ($this->_tpl_vars['paypal']['published'] == 1): ?>
         	<div class="paypal paymentitem">
            	<input type="radio" name="paymentmethod" value="paypal"  checked="checked" /> <strong>Paypal</strong>
                <p align="center">
                <img src="../../images/paypal.jpg">
                </p>
                
            </div>
		<?php endif; ?>
        <?php if ($this->_tpl_vars['nab']['published'] == 1): ?>
         	<div class="nab paymentitem">
            	<input type="radio" name="paymentmethod" value="nab"  /> <strong>NAB</strong><br />
                <div class="nablogo" style="margin-top:10px;">
            	<p align="center">
                	<img src="../../images/visa_mastercard_logo.gif" height="65" />
                	<img src="../../images/nab.jpg"  height="65"/>
                </p>
                </div>
                
                
                <dl>
                <dt>Card Type</dt>
                <dd>
                    <select class="input3" id="cardtype" name="cardtype">
                        <option value="">Select Card Type</option>
                        <option value="Visa" <?php if ($_POST['cardtype'] == 'Visa'): ?> selected="selected" <?php endif; ?>>VISA </option>
                        <option value="MasterCard" <?php if ($_POST['cardtype'] == 'MasterCard'): ?> selected="selected" <?php endif; ?>>Master Card </option>
                        <option value="AmEx" <?php if ($_POST['cardtype'] == 'AmEx'): ?> selected="selected" <?php endif; ?>>American Express </option>
                        
                    </select>
                </dd>
                <section class="clear"></section>
            </dl>
              
              
                
        <dl>
        	<dt>Card Number</dt>
            <dd><input type="text" class="input" name="cardnumber" id="cardnumber" maxlength="16" value="<?php echo $_POST['cardnumber']; ?>
" /></dd>
            <section class="clear"></section>
        </dl>
 
       	<dl class="space10">
        	<dt>Security Code</dt>
            <dd><input type="text" class="input10" name="cardcode" id="cardcode"  maxlength="4"  value="<?php echo $_POST['cardcode']; ?>
" /></dd>            
            <section class="clear"></section>
            
            <div style="color:#F00;" id="scode_msg"></div>
        </dl>
        <dl class="space40">
        	<dt>Expiration Date</dt>
            <dd>
             <section class="select_box_container">
                <select class="select Rmargin15" name="cardmonth" id="cardmonth">
                	<option value="">Select Month</option>
                    <?php unset($this->_sections['k']);
$this->_sections['k']['name'] = 'k';
$this->_sections['k']['start'] = (int)1;
$this->_sections['k']['loop'] = is_array($_loop=13) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['k']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['k']['show'] = true;
$this->_sections['k']['max'] = $this->_sections['k']['loop'];
if ($this->_sections['k']['start'] < 0)
    $this->_sections['k']['start'] = max($this->_sections['k']['step'] > 0 ? 0 : -1, $this->_sections['k']['loop'] + $this->_sections['k']['start']);
else
    $this->_sections['k']['start'] = min($this->_sections['k']['start'], $this->_sections['k']['step'] > 0 ? $this->_sections['k']['loop'] : $this->_sections['k']['loop']-1);
if ($this->_sections['k']['show']) {
    $this->_sections['k']['total'] = min(ceil(($this->_sections['k']['step'] > 0 ? $this->_sections['k']['loop'] - $this->_sections['k']['start'] : $this->_sections['k']['start']+1)/abs($this->_sections['k']['step'])), $this->_sections['k']['max']);
    if ($this->_sections['k']['total'] == 0)
        $this->_sections['k']['show'] = false;
} else
    $this->_sections['k']['total'] = 0;
if ($this->_sections['k']['show']):

            for ($this->_sections['k']['index'] = $this->_sections['k']['start'], $this->_sections['k']['iteration'] = 1;
                 $this->_sections['k']['iteration'] <= $this->_sections['k']['total'];
                 $this->_sections['k']['index'] += $this->_sections['k']['step'], $this->_sections['k']['iteration']++):
$this->_sections['k']['rownum'] = $this->_sections['k']['iteration'];
$this->_sections['k']['index_prev'] = $this->_sections['k']['index'] - $this->_sections['k']['step'];
$this->_sections['k']['index_next'] = $this->_sections['k']['index'] + $this->_sections['k']['step'];
$this->_sections['k']['first']      = ($this->_sections['k']['iteration'] == 1);
$this->_sections['k']['last']       = ($this->_sections['k']['iteration'] == $this->_sections['k']['total']);
?>
		                <option value="<?php echo ((is_array($_tmp=$this->_sections['k']['index'])) ? $this->_run_mod_handler('str_pad', true, $_tmp, 2, '0', @STR_PAD_LEFT) : str_pad($_tmp, 2, '0', @STR_PAD_LEFT)); ?>
" <?php if ($_POST['cardmonth'] == ((is_array($_tmp=$this->_sections['k']['index'])) ? $this->_run_mod_handler('str_pad', true, $_tmp, 2, '0', @STR_PAD_LEFT) : str_pad($_tmp, 2, '0', @STR_PAD_LEFT))): ?> selected="selected" <?php endif; ?>><?php echo ((is_array($_tmp=$this->_sections['k']['index'])) ? $this->_run_mod_handler('str_pad', true, $_tmp, 2, '0', @STR_PAD_LEFT) : str_pad($_tmp, 2, '0', @STR_PAD_LEFT)); ?>
</option>
                    <?php endfor; endif; ?>
                </select>
            </section>
             <section class="select_box_container">    
                <select class="select Rmargin15" name="carddate" id="carddate">
                	<option value="">Select Year</option>
                    <?php unset($this->_sections['yr']);
$this->_sections['yr']['name'] = 'yr';
$this->_sections['yr']['loop'] = is_array($_loop=$this->_tpl_vars['yr_arr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['yr']['show'] = true;
$this->_sections['yr']['max'] = $this->_sections['yr']['loop'];
$this->_sections['yr']['step'] = 1;
$this->_sections['yr']['start'] = $this->_sections['yr']['step'] > 0 ? 0 : $this->_sections['yr']['loop']-1;
if ($this->_sections['yr']['show']) {
    $this->_sections['yr']['total'] = $this->_sections['yr']['loop'];
    if ($this->_sections['yr']['total'] == 0)
        $this->_sections['yr']['show'] = false;
} else
    $this->_sections['yr']['total'] = 0;
if ($this->_sections['yr']['show']):

            for ($this->_sections['yr']['index'] = $this->_sections['yr']['start'], $this->_sections['yr']['iteration'] = 1;
                 $this->_sections['yr']['iteration'] <= $this->_sections['yr']['total'];
                 $this->_sections['yr']['index'] += $this->_sections['yr']['step'], $this->_sections['yr']['iteration']++):
$this->_sections['yr']['rownum'] = $this->_sections['yr']['iteration'];
$this->_sections['yr']['index_prev'] = $this->_sections['yr']['index'] - $this->_sections['yr']['step'];
$this->_sections['yr']['index_next'] = $this->_sections['yr']['index'] + $this->_sections['yr']['step'];
$this->_sections['yr']['first']      = ($this->_sections['yr']['iteration'] == 1);
$this->_sections['yr']['last']       = ($this->_sections['yr']['iteration'] == $this->_sections['yr']['total']);
?>
	                    <option value="<?php echo $this->_tpl_vars['yr_arr'][$this->_sections['yr']['index']]; ?>
" <?php if ($_POST['carddate'] == $this->_tpl_vars['yr_arr'][$this->_sections['yr']['index']]): ?> selected="selected" <?php endif; ?>><?php echo $this->_tpl_vars['yr_arr'][$this->_sections['yr']['index']]; ?>
</option>
                    <?php endfor; endif; ?>
                </select>
             </section>   
            </dd>
            <div id="date_error" style="color:#F00;"></div> 
            <section class="clear"></section>
        </dl>
    
        <dl>
        	<dt>Cardholder Name</dt>
            <dd><input type="text" class="input" name="card_holder" id="card_holder" value="<?php echo $_POST['card_holder']; ?>
" maxlength="20" /></dd>
            <section class="clear"></section>
        </dl>
   
            </div>
         
         </div>
         <?php endif; ?> 
         
        <section class="clear"></section>
        <?php if ($this->_tpl_vars['nab']['published'] == 1 || $this->_tpl_vars['paypal']['published'] == 1): ?>
        
        <div style="border-bottom:1px dotted #6BC3E6; margin-top: 20px;"></div>
        <dl>
        	<dt>&nbsp;</dt>
            <dd>
             <input type="hidden" name="btnstep4" id="btnstep4" value=""  />
    		 <input type="button" onclick="return validateFrm();"  value="Submit" class="blue_btn" > &nbsp;&nbsp;<input type="button" onclick="window.location.href='<?php echo $this->_tpl_vars['siteroot']; ?>
/leads/'"  value="Cancel" class="blue_btn" > 
    	    </dd>
        </dl>
        <?php else: ?>
        	<p>No Payment method !!!</p>
        <?php endif; ?>
        <section class="clear"></section>
    </section>
    <section class="clear"></section>

    </form>

    </section>
</section>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['footer'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>